import React from 'react';
import { AutoComplete } from 'choerodon-ui';
import { SelectValue } from 'choerodon-ui/lib/select';
import {useAutoCompleteBasic} from './hooks';

const AutoCompleteBasic: React.FC = () => {
  const [dataSource, handleSearch] = useAutoCompleteBasic();

  const handleSelect = (value: SelectValue, option: Object) => {
    console.log(value);
    console.log(option);
  };

  return (
    <AutoComplete
      dataSource={dataSource}
      style={{ width: 200 }}
      onSelect={handleSelect}
      onSearch={handleSearch}
      placeholder="input here"
    />
  );
};

export default AutoCompleteBasic;